#ifndef virtual_machine_h_20130727_2314_01
#define virtual_machine_h_20130727_2314_01

#include <vector>
using namespace std;

class virtual_machine {
public:
  enum class Instr {
    NOP,        // "No operation"
    PUSH,       // Push an object onto the stack.
    ADD,        // Add two stack operands and place the
                // result on the stack.
    SUB,        // Subtract a stack operand from another
                // and place the result on the stack.
    MUL,        // Multiply two stack operands and place the
                // result on the stack.
    DIV,        // Divide a stack operand by another and 
                // place the result on the stack.
    GET,        // retrieve an input event object and push
                // it onto the stack
    PUT,        // send an object to standard output
    MEMA,       // allocate an object and place its handle
                // on the stack
    MEMF,       // free an object previously allocated by
                // its handle
    JUMP,       // jump to another location in the code 
                // segment
    JE,         // if two stack operands are equal, jump to
                // another code location
    JNE,        // if two stack operands are not equal,
                // jump to another code location

    CONST_OP_COUNT
  };
private:
  vector<word> code_;
  vector<char> stack_;
  vector<object> heap_;
};


#endif//virtual_machine_h_20130727_2314_01
